home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
GETDFREE.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
530b
|
21 lines
/* getdfree.c --- p. 605 */
#include <stdio.h>
#include <dos.h>
main()
{
unsigned long total_space, free_space,
bytes_per_cluster;
struct dfree dfinfo;
getdfree(0, &dfinfo);
if(dfinfo.df_sclus == -1)
{
printf("Error in getdfree\n");
exit(0);
}
bytes_per_cluster = dfinfo.df_sclus * dfinfo.df_bsec;
total_space = dfinfo.df_total * bytes_per_cluster;
free_space = dfinfo.df_avail * bytes_per_cluster;
printf("%ld bytes free out of %ld bytes of total "
"space.\n", free_space, total_space);
}